package common.base.util.xmltool;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.collections.map.HashedMap;

import common.base.util.constant.ConditionCode;
import common.base.util.constant.ConditionMessage;
import common.base.util.constant.ResponseMessage;

public class ReqMessage {
	/**
	 * 请求消息reqData为null时的响应报文
	 */
	public static Map<String, HashedMap> getNoDataMessage(){
		Map<String, HashedMap> returnMap = new HashMap<String, HashedMap>();
		
		//封装响应头信息
		HashedMap headMap = new HashedMap();
		headMap.put(ResponseMessage.RETURN_MESSAGE, ConditionMessage.NO_DATA_MESSAGE);
		headMap.put(ResponseMessage.RETURN_CODE, ConditionCode.NO_DATA_CODE);
		returnMap.put(ResponseMessage.HEAD, headMap);
		
		//封装响应体信息
		HashedMap bodyMap = new HashedMap();
		bodyMap.put(ResponseMessage.RESULT, null);
		returnMap.put(ResponseMessage.BODY, bodyMap);
		
		return returnMap;
	}
	
	/**
	 * 上传文件类型有误的响应报文
	 * @return
	 */
	public static Map<String, HashedMap> getFileNameErrorMessage(){
		Map<String, HashedMap> returnMap = new HashMap<String, HashedMap>();
		
		//封装响应头信息
		HashedMap headMap = new HashedMap();
		headMap.put(ResponseMessage.RETURN_MESSAGE, ConditionMessage.EXCEPTION_FILETYPEERROR_MESSAGE);
		headMap.put(ResponseMessage.RETURN_CODE, ConditionCode.EXCEPTION_FILETYPEERROR_CODE);
		returnMap.put(ResponseMessage.HEAD, headMap);
		
		//封装响应体信息
		HashedMap bodyMap = new HashedMap();
		bodyMap.put(ResponseMessage.RESULT, null);
		returnMap.put(ResponseMessage.BODY, bodyMap);
		
		return returnMap;
	}
	
	/**
	 * 文件未经过校验而直接上传
	 * @return
	 */
	public static Map<String, HashedMap> getFileNotCheckMessage(){
		Map<String, HashedMap> returnMap = new HashMap<String, HashedMap>();
		
		//封装响应头信息
		HashedMap headMap = new HashedMap();
		headMap.put(ResponseMessage.RETURN_MESSAGE, ConditionMessage.EXCEPTION_FILENOTCHECKERROR_MESSAGE);
		headMap.put(ResponseMessage.RETURN_CODE, ConditionCode.EXCEPTION_FILENOTCHECKERROR_CODE);
		returnMap.put(ResponseMessage.HEAD, headMap);
		
		//封装响应体信息
		HashedMap bodyMap = new HashedMap();
		bodyMap.put(ResponseMessage.RESULT, null);
		returnMap.put(ResponseMessage.BODY, bodyMap);
		
		return returnMap;
	}
	
	
	
}